/*
Global varaibles shared by all shaders
*/
shared float4x4 World;
shared float4x4 View;
shared float4x4 Projection;
shared float4x4 InvView;
shared float4x4 InvViewProjection;
shared float Time;

/*
Global data structures
*/

struct vsGeometryIn
{
    float4 position0 : POSITION0;
    float3 normal0 : NORMAL0;
    float3 tangent0 : TANGENT0;
    float2 uv0 : TEXCOORD0;
    float2 uv1 : TEXCOORD1;
    float4 boneWeights : BONEWEIGHT0;
    float4 boneIndicies : BONEINDICIES0;
};

struct vsGeometryOut
{
    float4 positionSys : POSITION0;
    float2 uv0 : TEXCOORD0;
    float2 uv1 : TEXCOORD1;
    float3 normal0 : TEXCOORD2;
    float4 position0 : TEXCOORD3;
    float4 color0 : COLOR0;
};

typedef vsGeometryOut psGeometryIn;

/*
Global utility functions
*/
float3 GetCameraPosition() {
	
	return InvView[3];
}

float2 GetHomogenToScreen(float4 proj)
{	
	proj.y *= -1;
	float2 temp = (0.5 * (proj.xy / proj.w)) + 0.5;
	return temp;
}